import os, django
from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dingxiang_doctor.settings')
django.setup()

# app = Celery('dingxiang_doctor')
app = Celery('dingxiang_doctor', broker='redis://:123456@127.0.0.1:6379/0',  # 任务存放的地方
             backend='redis://:123456@127.0.0.1:6379/0')

# app.config_from_object('mycelery.settings', namespace='dingxiang_doctor')

app.config_from_object('django.conf:settings')

# 加载任务
app.autodiscover_tasks(["mycelery.all_task"])
